#include <stdio.h>
#include "ircbot.h"
//#pragma comment(lib, "ws2_32.lib")

int main(int argc, char *argv[]) {
	irc_info_t	*irc_info;
	char		incoming[MAX_LEN];
	//WSADATA		wsa_data;

	if(0 != 0) {
		puts("failed to start winsock");
	} else {
		irc_info = malloc(sizeof(irc_info_t));
		irc_info->nick		= "wat";
		irc_info->user		= "wat";
		irc_info->port		= 6667;
		irc_info->server	= "irc.malvager.com";
		if(irc_connect(irc_info) && irc_join(irc_info, "#c++")) {
			//while((incoming = irc_read(irc_info)) != (char*)NULL) {
			//		printf("%s\n", incoming);
			//}
			puts("woot");
			while(irc_read(irc_info, incoming)) {
				printf("%s\n", incoming);
			}
		} else {
			puts("bleh");//printf("irc_connect() failed (%d).", WSAGetLastError());
		}
	}
	getchar();

	//WSACleanup();
	if(irc_info) free(irc_info);
	return 0;


}
